<template>
	<div class="header">
		<div class="content-wrapper">
			<div class="avatar">
				<img width="64" height="64" :src="seller.avatar"/>
			</div>
			<div class="content">
				<div class="title">
					<span class="brand"></span>
					<span class="name">{{seller.name}}</span>
				</div>
				<div class="description">
					{{seller.description}}/{{seller.deliveryTime}}分钟送达
				</div>
				<div v-if='seller.supports' class="support">
					<v-icon :icon_type='seller.supports[0].type' :icon_num='1'></v-icon>
					<!--<span class="icon" :class="classMap[seller.supports[0].type]"></span>-->
					<span class="text">{{seller.supports[0].description}}</span>
				</div>
			</div>
			<div v-if="seller.supports" class="support-count">
				<span class="count">{{seller.supports.length}}个</span>
				<i class="icon-keyboard_arrow_right" @click="showDetail">右箭头</i>
			</div>
		</div>
		<div class="bulletin-wrapper">
			<span class="bulletin-title"></span>
			<span class="bulletin-text">{{seller.bulletin}}</span>
			<i  @click="showDetail">右箭头</i>
		</div>
		<div class="hd-bg">
			<img :src="seller.avatar"/>
		</div>
		<transition name='fade'>
			<div v-show="detailShow" class="detail">
				<div class="detail-wrapper clearfix">
					<div class="detail-main">
						<h1 class="name">{{seller.name}}</h1>
						<div class="star-wrapper">
							<v-star :score='seller.score' :size='48'></v-star>
						</div>
						<div class="title">
			            	<div class="line"></div>
			            	<div class="text">优惠信息</div>
			            	<div class="line"></div>
			          	</div>
			          	<ul v-if="seller.supports" class="supports">
				            <li class="support-item" v-for="item in seller.supports">
				            	<span style="margin-right: 6px;"><v-icon :icon_type='item.type' :icon_num='2'></v-icon></span>
				              <!--<span class="icon" :class="classMap[item.type]"></span>-->
				              <span class="text">{{item.description}}</span>
				            </li>
			          	</ul>
			          	<div class="title">
			            	<div class="line"></div>
			            	<div class="text">商家公告</div>
			            	<div class="line"></div>
			          	</div>
			          	<div class="bulletin">
			            	<p class="content">{{seller.bulletin}}</p>
			          	</div>
					</div>
				</div>
				<div class="detail-close">
					<i @click="hideDetail">关闭按钮</i >
				</div>
			</div>
		
		</transition>
			
	</div>
</template>

<script type="text/ecmascript-6">
	import star from '../public/star.vue'
	import icon from '../public/icon.vue'
	export default {
	  props: {
	  	seller:{
	  		type: Object
	  	}
	  },
	  data(){
	  	return{
	  		detailShow: false
	  	}
	  },
	  methods:{
	  	showDetail: function(){
	  		this.detailShow = true
	  	},
	  	hideDetail: function(){
	  		this.detailShow = false
	  	}
	  },
	  components:{
	  	'v-star': star,
	  	'v-icon': icon
	  }
	}
</script>
<style lang="stylus">
	@import "../../common/stylus/mixin.styl"
	.header{
		color: #fff;
		position: relative;
		background: rgba(7,17,27,0.5);
		overflow: hidden;
	}
	.bulletin .content{
		font-size: 12px;
		line-height: 24px;
	}
	.hd-bg{
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: -1;
		filter:blur(10px);
		img{
			width: 100%;
			height: 100%;
		}
	} 
	.header .content{
		display: inline-block;
	} 
	.header .avatar{
		border-radius: 2px;
		overflow: hidden;
		display: inline-block;
	}
	.header .detail{
		position: fixed;
		z-index: 999;
		width: 100%;
		left: 0;
		top: 0;
		height: 100%
      	overflow: auto;
      	transition: 0.5s
		background: rgba(7,17,27,0.8);
      	&.fade-enter-active, &.fade-leave-active {
		  transition: opacity .5s;
		}
		&.fade-enter, &.fade-leave-to {
		  opacity: 0;
		}
		
      	.detail-wrapper{
      		width: 100%;
      		min-height: 100%;
      	}
      	.detail-main{
      		padding: 64px 36px 64px 36px;
      		.name{
      			text-align: center;
      			font-size: 16px;
      			font-weight: 700;
      		}
      		.star-wrapper{
      			margin-top: 18px;
      		}
      		.title{
      			display: flex;
      			margin-top: 28px;
      			margin-bottom: 24px;
      			.text{
      				padding: 0 12px;
      				font-size: 15px;
      				font-weight: 700;
      			}
      			.line{
      				flex: 1;
      				position: relative;
      				top: -6px;
      				border-bottom: 1px solid rgba(255,255,255,0.2);
      			}
      		}
      		.supports{
      			padding: 0 12px;
      			font-size: 0;
      			.support-item{
      				margin-bottom: 6px;
      				&:last-child{
      					margin-bottom: 0;
      				}
      				.text{
      					font-size: 12px;
      				}
      			}
      		}
      	}
      	.detail-close{
      		text-align: center;
      		height: 32px;
      		margin: -64px auto 0 auto;
      		padding-top: 20px;
      	}
	}
	.header .content-wrapper{
		padding: 24px 12px 18px 24px;
		font-size: 14px;
		position: relative;
		.support-count{
			position: absolute;
			right: 12px;
			bottom: 14px;
			padding: 0 8px;
			height: 24px;
			line-height: 24px;
			border-radius: 14px;
			background:rgba(0,0,0,0.2);
			text-align: center;
			.count{
				font-size: 10px;
			}
		}
	}
	.header .content{
		margin-left: 16px;
		.title{
			margin: 2px 0 8px 0;
			.brand{
				display: inline-block;
				vertical-align: middle;
				width: 30px
				height: 18px
				bg-image('brand')
				background-size: 30px 18px
				background-repeat: no-repeat
			}
			.name{
				margin-left: 6px;
				font-size: 16px;
				color: #fff;
				font-weight: bold;
			}
		}
		.description{
			margin-top: 8px;
			margin-bottom: 10px;
			font-size: 12px;
			font-weight: 200;
		}
		.support .text{
            font-size: 10px
		}
	}
	
	.bulletin-wrapper{
		height: 28px;
		line-height: 28px;
		padding-left: 12px;
		padding-right: 22px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		position: relative;
		
		.bulletin-title{
			display: inline-block;
			width: 22px;
			height: 12px;
			bg-image('bulletin');
			background-repeat: no-repeat;
			background-size: contain;
			vertical-align: middle;
			margin-right: 5px;
		}
		.bulletin-text{
			font-size: 10px;
		}
		i{
			font-size: 10px;
			position: absolute;
			right: 2px;
			top: 2px;
		}
	}	
		
</style>